Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

remark-remove-comments

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-remove-comments

Remark plugin to remove HTML comments from the processed output

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3K
decreased by-60.8%
Maintainers
1
Weekly downloads
 
Created
Source

remark-remove-comments

Downloads Size

Remark plugin to remove HTML comments from the processed output.

Install

npm:

npm install remark-remove-comments

Use

Say we have the following file, example.md:

# Hello World

This is a markdown file, with text in it.

<!-- But in this file there's a comment, like "TODO: fix 😅",
  I don't want this to appear in the HTML output, it's just for me -->

And our script, example.js, looks as follows:

const fs = require('fs');
const remark = require('remark');
const removeComments = require('remark-remove-comments');

remark()
  .use(removeComments)
  .process(fs.readFileSync('example.md', 'utf-8'), function (err, file) {
    if (err) throw err;
    console.log(String(file));
  });

Now, running node example yields:

# Hello World

This is a markdown file, with text in it.

API

remark().use(removeComments)

Removes comments.

  • Removes every HTML node that matches this regex

License

MIT © https://alvin.codes/

Keywords

FAQs

Package last updated on 19 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc